﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Admin_AdminLogin:System.Web.UI.Page
{
	protected void Page_Load(object sender,EventArgs e)
	{
		///
	}
	protected void btnSaveAsConfigure_Click(object sender,EventArgs e)
	{
		if(true == SysOperation.StringNullChecked(tbName.Text.Trim()) 
			|| true == SysOperation.StringNullChecked(tbPassword.Text.Trim()))
		{
			IUser user = new User();
			SqlDataReader dr = user.GetUserLogin(tbName.Text.Trim(),
				tbPassword.Text.Trim());

			bool isLogin = false;
			if(dr.Read())
			{
				Session[SystemConst.USERIDKEY] = dr["ID"].ToString();
				isLogin = true;
			}
			dr.Close();

			if(true == isLogin)
			{
				Response.Redirect("~/Admin/Index.aspx");
			}
		}
	}
}
